package test.db.table.oracle.type;

import test.db.table.Table;

/**
 * @author newbie
 * @since 0.1
 */
public enum PwTablePartitionTable implements Table {
    TABLE_NAME(Column.tableName),
    ROW_ID(Column.rowId),
    PARTITION_NO(Column.partitionNo),
    CATEGORY(Column.category),
    ROW_CNT(Column.rowCnt);
    
    private final Column column;
    private static final String TYPE_TABLE_NAME = "VARCHAR2(20)";
    private static final String TYPE_ROW_ID = "VARCHAR2(20)";
    private static final String TYPE_PARTITION_NO = "NUMBER(9)";
    private static final String TYPE_CATEGORY = "VARCHAR2(18)";
    private static final String TYPE_ROW_CNT = "NUMBER(9)";
    
    PwTablePartitionTable(Column column) {
        this.column = column;
    }
    
    private enum Column {
        tableName {
            String getType() {
                return TYPE_TABLE_NAME;
            }
        },
        
        rowId {
            String getType() {
                return TYPE_ROW_ID;
            }
        },
        
        partitionNo {
            String getType() {
                return TYPE_PARTITION_NO;
            }
        },
        
        category {
            String getType() {
                return TYPE_CATEGORY;
            }
        },
        
        rowCnt {
            String getType() {
                return TYPE_ROW_CNT;
            }
        };
        
        abstract String getType();
    }
    
    public String getType() {
        return column.getType();
    }
    
    public void initData() throws Exception {
    }
}